package com.weiyirong99.crm.app;

import android.app.Application;
import android.content.Context;

import com.hjq.permissions.XXPermissions;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;
import com.tencent.mmkv.MMKV;

import cn.jiguang.joperate.api.JOperateInterface;
import cn.jpush.android.api.JPushInterface;


/**
 * author  by  Canrom7 .
 * CreateDate 2021/8/26 17:16
 * Class App
 */
public class App extends Application {

    private static final String TAG = "App";
    public static Context appContext;
    public static boolean canUpload=true;

    @Override
    public void onCreate() {
        super.onCreate();
        appContext = this;
        initData();
    }

    private void initData() {
        //初始化缓存工具

        MMKV.initialize(appContext);
        //初始化权限
        XXPermissions.setScopedStorage(true);
        //初始化数据库
//        LitePal.initialize(appContext);
        //初始化日志
        Logger.addLogAdapter(new AndroidLogAdapter());

//        JPushInterface.setDebugMode(true);//正式版的时候设置false，关闭调试
//        JPushInterface.init(this);
//        JOperateInterface.setDebug(true);//生产环境须删除
        JOperateInterface.getInstance(getApplicationContext()).init();

    }

}